package com.suredy.base.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinTable;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.annotations.Cascade;

@Entity
@Table(name="V_E_QZ")
public class Role
{
  private String id;
  private String groupName;
  private Set<User> userSet = new HashSet<User>();

  @Id
  public String getId() {
    return this.id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public String getGroupName() {
    return this.groupName;
  }

  public void setGroupName(String groupName) {
    this.groupName = groupName;
  }

  @OneToMany(fetch=FetchType.EAGER)
  @Cascade({org.hibernate.annotations.CascadeType.ALL})
  @JoinTable(name="T_E_QZYH", joinColumns={@javax.persistence.JoinColumn(name="ID_E_QZ")}, inverseJoinColumns={@javax.persistence.JoinColumn(name="ID_E_YH")})
  public Set<User> getUserSet()
  {
    return this.userSet;
  }

  public void setUserSet(Set<User> userSet) {
    this.userSet = userSet;
  }
}